@echo off
setlocal
:: bootstrap
pushd %~dp0
call _configure.bat
popd
set base_dir=%CERTIFICATE_DIR%
set OPENSSL_CONF=%OPENSSL_CONF%
set ssl_exec=%SSL_EXEC_FILE%
set /p domain_name=Set Domain name

set cert_file=%base_dir%\%domain_name%

call %ssl_exec% req -new -out "%cert_file%.csr" -keyout "%cert_file%.pem"
call %ssl_exec% rsa -in "%cert_file%.pem" -out "%cert_file%.key"
call %ssl_exec% x509 -in "%cert_file%.csr" -out "%cert_file%.crt" -req -signkey "%cert_file%.key" -days 365

endlocal